package com.opensdk;

import java.io.Serializable;

public class Parameter implements Serializable, Comparable<Parameter> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8067953736119980048L;

	private String pName;
	
	private String pValue;
	
	public Parameter(String name,String value){
		this.pName = name;
		this.pValue = value;
	}
	
	public String getName(){
		return this.pName;
	}
	
	public String getValue(){
		return this.pValue;
	}
	@Override
	public boolean equals(Object arg0) {
		if (null == arg0) {
            return false;
        }
        if (this == arg0) {
            return true;
        }
        if (arg0 instanceof Parameter) {
            Parameter param = (Parameter) arg0;
            
            return this.pName.equals(param.pName) &&
                this.pValue.equals(param.pValue);
        }
        return false;
	}
	
	public int compareTo(Parameter param) {
		int compared;
        compared = pName.compareTo(param.pName);
        if (0 == compared) {
            compared = pValue.compareTo(param.pValue);
        }
        return compared;
	}

}
